package com.qiandw.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.server.WebSession;

/**
 * @author coxx
 */
@Controller
public class AuthController {
    @RequestMapping("/login")
    public String login(Model model, WebSession webSession){
        return "login";
    }
    @RequestMapping("/login?{error}")
    public String error(@PathVariable("error") String error, Model model, WebSession webSession){
        if("error".equals(error)) {
            model.addAttribute("loginError", true);
        }
        return "login";
    }
}
